<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    var a=[10,5,11,9,13];
    for(var i=0;i<a.length-1;i++){
        for(var j=0;j<a.length-1-i;j++){
            if(a[j]>a[j+1]){//从小到大a[j]<a[j+1]从大到小
                temp=a[j];
                a[j]=a[j+1];
                a[j+1]=temp
            }
        }
    }
    document.write(a)
</script>
</script>
</body>
</html>